﻿namespace System.Web.Mvc
{
    /// <summary>
    /// UrlHelper扩展
    /// </summary>
    public static class UrlHelperExtensions
    {
        /// <summary>
        /// 将现有实例转换为UrlToHelper
        /// </summary>
        /// <typeparam name="TController">控制器类型</typeparam>
        /// <param name="helper">UrlHelper实例</param>
        /// <returns>UrlToHelper实例</returns>
        public static UrlToHelper<TController> To<TController>(this UrlHelper helper) where TController : Controller
        {
            return new UrlToHelper<TController>(helper);
        }
    }
}
